ACTOR "ShrunkDukePlayer" : PlayerPawn Replaces ChickenPlayer
{
	Speed 0.5
    Health 30
    Radius 16
    Height 24
    Mass 120
    PainChance 255
    ReactionTime 0
	Player.SpawnClass "Chicken"
    Player.DisplayName "Duke Shrunk"
    Player.MorphWeapon "Nothing"
    Player.ColorRange 112, 127
    Player.SoundClass "DN3D"
    Player.ViewHeight 16
    Player.ForwardMove 0.72
    Player.SideMove 0.62
    Player.JumpZ 0
    Scale 0.2 
	DamageFactor "Damage_Foot", 0.25
	DamageFactor "Damage_Pistol", 0.47
    DamageFactor "Damage_DualPistol", 0.47
	DamageFactor "Damage_BlackTail", 0.47
    DamageFactor "Damage_DualBlackTail", 0.47
	DamageFactor "Damage_DesertEagle", 0.47
    DamageFactor "Damage_Shotgun", 9.0
	DamageFactor "Damage_SuperShotgun", 0.48
	DamageFactor "Damage_ExplosiveShotgun", 0.58
    DamageFactor "Damage_ChaingunCannon", 0.49
	DamageFactor "Damage_Minigun", 0.49
	DamageFactor "Damage_LMGBullet", 0.56
    DamageFactor "Damage_Explosion", 1.40
	DamageFactor "Devastator", 1.04
	DamageFactor "Damage_Pipes", 0.59
	DamageFactor "Damage_Tripbomb", 0.61
	DamageFactor "Damage_Shock", 0.39
	DamageFactor "Damage_BigShock", 0.38
	DamageFactor "Damage_Thunder", 0.39
	DamageFactor "Damage_BigThunder", 0.38
	DamageFactor "LaserExplosion", 0.0
    DamageFactor "Damage_Shrinker", 0.1
	DamageFactor "Damage_Expander", 0.26
	DamageFactor "Damage_Laser", 0.76
	DamageFactor "Damage_Railgun", 0.34
	DamageFactor "Damage_RailgunAvenger", 0.34
    DamageFactor "Ice", 0.18
    DamageFactor "Fire", 0.32
	DamageFactor "Damage_Pulse", 1.04
	DamageFactor "Trip_Punch", 0.0
	DamageFactor "Radial", 0.0
    +CANSUPERMORPH
    -PICKUP
    States
    {
    Spawn:
	    DUKE A 0 A_JumpIfInventory("JetPackActive",1,"Spawn2")
		DUKE A 0 A_StopSoundEx("SoundSlot7") 
        DUKE AA 0 A_TakeInventory("DukeRunning",1)		
        DUKE A 0 A_JumpIfInventory("DukeShrinkCounter",80,"UnShrink")
        DUKE AAAA 4 A_GiveInventory("DukeShrinkCounter",1)
        Loop
	Spawn2:	
	    DUKE B 0 
        DUKE BB 0 A_TakeInventory("DukeRunning",1)	
		DUKE B 0 A_PlaySoundEx("JetPack/Active","SoundSlot7",2) 
        DUKE B 0 A_JumpIfInventory("DukeShrinkCounter",80,"UnShrink")
        DUKE BBBB 4 A_GiveInventory("DukeShrinkCounter",1)
	    Goto Spawn
    See:
	    DUKE C 0 A_JumpIfInventory("JetPackActive",1,"See2")
		DUKE C 0 A_StopSoundEx("SoundSlot7") 
        DUKE C 0 A_JumpIfInventory("DukeShrinkCounter",80,"UnShrink")
        DUKE C 0 A_GiveInventory("DukeRunning",1)
        DUKE CDEF 4 A_GiveInventory("DukeShrinkCounter",1)
        Loop
	See2:
	    DUKE B 0 
		DUKE B 0 A_PlaySoundEx("JetPack/Active","SoundSlot7",2) 
        DUKE B 0 A_JumpIfInventory("DukeShrinkCounter",80,"UnShrink2")
        DUKE B 0 A_GiveInventory("DukeRunning",1)
        DUKE BBBB 4 A_GiveInventory("DukeShrinkCounter",1)
        Goto See
    UnShrink:
        DUKE C 4 A_TakeInventory("DukeShrinkCounter",80)
        DUKE DEF 4 A_GiveInventory("DukeShrinkRevertItem",1)
        Goto See
	UnShrink2:
        DUKE B 4 A_TakeInventory("DukeShrinkCounter",80)
        DUKE BBB 4 A_GiveInventory("DukeShrinkRevertItem",1)
        Goto See
    Melee:
    Missile:
        DUKE A 0
        Goto Spawn 
	Pain:
		DUKE A 1 A_TakeInventory("Waiting",15)
        DUKE A 1 A_Pain
        Goto Spawn
	Pain.Damage_Explosion:
	Pain.Damage_ExplosiveShotgun:
	Pain.Damage_Shock:
	Pain.Damage_BigShock:
	    DUKE A 0 A_Jump(128,"Mad")
		DUKE A 1 A_TakeInventory("Waiting",15)
        DUKE A 1 A_Pain
        Goto Spawn
	Mad:	
	    DUKE A 1 A_TakeInventory("Waiting",15)
        DUKE A 1 A_PlaySound("DukeNukem/Mad",3) 
        Goto Spawn
	Pain.LaserShot:
	    DUKE A 0 
		DUKE A 0 A_SpawnItemEx("PainTripLaser",0,0,8)
		DUKE A 0 HealThing(1)
		Goto Spawn
	Pain.Ice:
        DUKE A 0  
		DUKE A 0 A_TakeInventory("Waiting",15)
		DUKE A 1 A_Pain
        DUKE A 1 ACS_ExecuteAlways(508,0)
        Goto Spawn
	Pain.Fire:
        DUKE A 0  
		DUKE A 0 A_TakeInventory("Waiting",15)
		DUKE A 1 A_PlaySound("DukeNukem/Burn",3) 
        DUKE A 1 ACS_ExecuteAlways(509,0)
        Goto Spawn	
	Pain.LizardSpit:
		DUKE A 0  
		DUKE A 0 A_JumpIfInventory("LizardSpitWindow",1,"Pain") 		
		DUKE A 0 A_TakeInventory("Waiting",15)
		DUKE A 1 A_PlaySound("DukeNukem/Mad",3) 
		DUKE A 0 A_GiveInventory("LizardSpitWindow",1)
        DUKE A 1 ACS_ExecuteAlways(526,0)
        Goto Spawn		
	Pain.Brain:
        DUKE A 0  
		DUKE A 0 A_TakeInventory("Waiting",15)
		DUKE A 1 A_Pain
        DUKE A 1 ACS_ExecuteAlways(527,0)
        Goto Spawn	
    Death:
	    DUKE A 0
        DUKE A 1 A_PlaySound("DukeNukem/DeathLittle",5)
		DUKE A 0 A_StopSoundEx("SoundSlot7") 
        DUKE A 0 A_NoBlocking
        DUKE A 0 A_SpawnDebris("DukeGibs1")
        DUKE A 0 A_SpawnDebris("DukeGibs2")
		DUKE A 0 A_SpawnDebris("DukeGibs3")
        DUKE A 0 A_SpawnDebris("DukeGibs4")
        DUKE A 0 A_SpawnDebris("DukeGibs5")		
        DUKE AAAAA 0 A_SpawnDebris("DukeGibs6")
		TNT1 A 1 ACS_ExecuteAlways(506,0,0,0,0)
	    TNT1 A -1
	    Stop
        }
}

ACTOR DukeShrinkRevert : ArtiTomeOfPower
{
    -COUNTITEM
    +INVENTORY.AUTOACTIVATE
    Powerup.Duration 35
	Inventory.MaxAmount 1
    Inventory.Icon "TNT1A0"
}

ACTOR DukeShrinkCounter : Inventory
{
    Inventory.Amount 0
    Inventory.MaxAmount 100
}

ACTOR DukeShrinkRevertItem : CustomInventory
{
    Inventory.PickupMessage ""
    Inventory.MaxAmount 100
    Inventory.Amount 1
    +INVENTORY.AUTOACTIVATE 
    +INVENTORY.QUIET
    Scale 0.35
    States
    {
    Spawn:
        TNT1 A 5
        Stop
    Pickup:
        SHTP A 0 A_GiveInventory("DukeShrinkRevert",1)
        SHTP A 0 A_TakeInventory("Nothing",1)
        Stop
        }
}